Skip to content

feat(daemon): device.rotate rotates a leased iOS simulator - #1122

Merged
V3RON merged 31 commits into
callstackincubator:mainfrom
leonardoxr:task/1107
Oct 31, 2026
Merged

V3RON merged 31 commits into
callstackincubator:mainfrom
leonardoxr:task/1107

Conversation

@leonardoxr

@leonardoxr leonardoxr commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1107

Status

Build, audit and the one review fix pass are complete: every Tests line has a test and its code (tracer, ROTATION_UNSUPPORTED, INPUT_UNAVAILABLE, the daemon's per-lease device input shared with the input module, HTTP route and gateway forward, client.rotate, parseOrientation), and the docs. CodeRabbit is not reviewing this repository at the moment (no activity on any PR since 2026-10-30 20:25 UTC), so this PR had the blind spec/code/claims review only.

Done when

  • The Tests lines pass; src/input/worker.test.ts and src/daemon/input-lease.e2e.test.ts pass with only the fake's shape changed.
  • operations.test.ts's role and effect matrices hold device.rotate.
  • The errors reference lists both codes; the HTTP reference lists the route; watching-the-screen says rotation is also POST /v1/leases/{id}/rotate, with the input module off.

Assumptions

  • Assumption: where the alias parser lives and what it returns — the contract's orientation.ts (per the spec's module list), parseOrientation(input) returning {ok, orientation} or {ok: false, message}.
  • Assumption: client.rotate's signature — rotate(leaseId, orientation, options?: {requesterId}); the optional requesterId is how the gateway forwards the lease's namespaced requester, as exec's input does.
  • Assumption: ModuleInputs.openInput is replaced by leaseInput — nothing else used it.

Review

Spec review: 2 blocking, 2 fixed, 0 notes. Code review: 3 blocking, 3 fixed, 0 notes. Claims review: 2 blocking, 2 fixed, 0 notes.
Round 2: Spec review: 1 blocking, 1 fixed, 1 note. Code review: 3 blocking, 3 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.

  • R1 (code): rotate reserved as a core lease sub-route, with its refusal in the reserved-name test — 44ba688
  • R2 (code): device.rotate input bounds and .strict() tested — b90d8f4
  • R3 (code): the forwarded rotate's gateway.execTimeoutMs bound tested on a fake clock — f4f1484, b8643d1 (stale Fallow suppression)
  • R4 (spec): duplicate failed-open case removed from lease-inputs.test.ts — 84bf37d
  • R5 (spec, note): Android send swallows a failed write — not fixed (non-blocking)
    Rounds: 2. Tokens: n/a.
    Assessment: complete

Written by an agent.

leonardoxr and others added 18 commits October 31, 2026 00:50
…tation, and is refused (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r and gets ROTATION_UNSUPPORTED naming it (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…blet simulator (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s and gets INPUT_UNAVAILABLE with the reason (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… when the helper or the write fails (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…esh helper; a socket open during a rotate keeps its helper (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s sockets and device.rotate (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…gets the op's output (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rotate (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ugh a gateway (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eway (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…wn message (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…he unknown message (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ller's lease id (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
leonardoxr and others added 3 commits October 31, 2026 01:26
…otating (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hat proves it (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@leonardoxr
leonardoxr marked this pull request as ready for review October 31, 2026 04:28
@leonardoxr

leonardoxr commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 0844848

Runs: 9. Cost USD: 11.2318. Agent seconds: 4530.
Tokens input 770, output 255139, cache read 35301523, cache write 1375883.
- build implementer: claude-sonnet-5-5 409 s $0.8626
- build implementer: claude-sonnet-5-5 145 s $0.3968
- build implementer: claude-sonnet-5-5 1174 s $3.1917
- audit implementer: claude-sonnet-5-5 546 s $0.7855
- review 1 reviewer: claude-sonnet-5-5 754 s $0.4266
- review 1 spec: claude-sonnet-5-5 107 s $0.5248
- review 1 code both: claude-opus-5-5 552 s $3.4179
- review 1 claims: claude-sonnet-5-5 70 s $0.2716
- fix 1 implementer: claude-sonnet-5-5 773 s $1.3543
Finding outcomes: {"duplicate":2,"fixed":5,"incorrect":1}. Classes: {"ADR 0053 cited but not on base":1,"comment claims unshipped CLI and MCP callers":1,"documentation 9 manual omits changed surface":2,"gateway names worker lease id in refusal":1,"testing 2 registry drop and lease-end close untested":1,"testing 3 rotate to portrait_upside_down unproven":2}.
{"findings":[{"id":"R1","role":"spec","class":"testing 3 rotate to portrait_upside_down unproven","outcome":"fixed","path":"src/daemon/device-rotate.e2e.test.ts","round":"1","fix":"7aa86a78"},{"id":"R2","role":"code","class":"testing 2 registry drop and lease-end close untested","outcome":"fixed","path":"src/daemon/device-rotate.e2e.test.ts","round":"1","fix":"7aa86a78"},{"id":"R3","role":"code","class":"gateway names worker lease id in refusal","outcome":"fixed","path":"src/gateway/fleet-coordinator.ts","round":"1","fix":"7aa86a78"},{"id":"R4","role":"spec","class":"documentation 9 manual omits changed surface","outcome":"fixed","path":"src/http/AGENTS.md","round":"1","fix":"63821880"},{"id":"R5","role":"claims","class":"comment claims unshipped CLI and MCP callers","outcome":"fixed","path":"src/contract/orientation.ts","round":"1","fix":"63821880"},{"id":"R6","role":"claims","class":"ADR 0053 cited but not on base","outcome":"incorrect","path":"src/daemon/lease-inputs.ts","round":"1"},{"id":"R7","role":"spec","class":"testing 3 rotate to portrait_upside_down unproven","outcome":"duplicate","canonicalId":"R1","path":"src/daemon/device-rotate.e2e.test.ts","round":"1"},{"id":"R8","role":"claims","class":"documentation 9 manual omits changed surface","outcome":"duplicate","canonicalId":"R4","path":"src/contract/AGENTS.md","round":"1"}]}

Written by an agent.

@leonardoxr

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Written by an agent.

leonardoxr and others added 2 commits October 31, 2026 02:10
…rove rotate's cases (callstackincubator#1107)

The coordinator rewrote the worker's lease id only for two codes and with a
substring replace; it now maps every coded error's details.leaseId and replaces
the id only as a whole token. The rotate e2e test sends all four orientation
names, covers a rejected open and a failed shared input, and no longer waits on
the daemon's real host-load probe on Linux; the registry's lease-end close and
failure drop get a unit test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ls, and reword the orientation claims (callstackincubator#1107)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@V3RON
V3RON merged commit 603f52f into callstackincubator:main Oct 31, 2026
31 checks passed
V3RON added a commit that referenced this pull request Oct 31, 2026
Closes #1108

### Status

Stacked on #1122; its diff includes #1122's commits until #1122 merges.
CodeRabbit is not reviewing this repository at the moment (no activity
on any PR since 2026-10-30 20:25 UTC), so this PR had the blind
spec/code/claims review only.

- [x] The Tests lines pass, with `server.test.ts`'s schema-key table
(F11) holding `rotate_device`. (`src/cli/index.test.ts` "simlock
rotate", `src/mcp/server.test.ts` "MCP rotate_device" and the smoke
test's tool table)
- [x] `simlock rotate --help`, the root usage and the CLI reference
agree; `simlock instructions` and connect-your-agent list
`rotate_device`. (`src/cli/commands/rotate.ts`, `src/cli/index.ts`,
`cli.mdx`, `src/instructions/index.ts`, `connect-your-agent.mdx`)

## Assumptions

none

## Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 3 blocking, 3
fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Round 2: Spec review: 1 blocking, 1 fixed, 0 notes. Code review: 1
blocking, 1 fixed, 1 note. Claims review: 0 blocking, 0 fixed, 0 notes.
- R1 (code): `simlock rotate` row in the CLI reference's command table —
aea4fb3
- R2 (spec): `simlock rotate` through a gateway (`--gateway`) case added
to the rotate CLI test — fbfc5a7
- R3 (code, note): `src/instructions/index.ts`, documentation 8 — not
fixed (non-blocking)
- task/1107 round-2 fixes merged in — 54dd125
Rounds: 2. Tokens: n/a.
Assessment: complete

*Written by an agent.*

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Szymon Chmal <szymon@chmal.it>
V3RON added a commit that referenced this pull request Oct 31, 2026
… through device.rotate (#1124)

Closes #1109

### Status

Stacked on #1122. CodeRabbit is not reviewing this repository at the
moment (no activity on any PR since 2026-10-30 20:25 UTC), so this PR
had the blind spec/code/claims review only. The manual Mac check line
stays unticked: it is the maintainer's.

- [x] The Tests lines pass. (`front/orientation.test.ts`; both tests)
- [x] Manual check (maintainer, worker Mac): through a gateway, `POST
/v1/leases/{id}/rotate {"orientation":"landscape_left"}` turns a leased
iPhone simulator running the Appduct fixture app to landscape, and after
the same call with `portrait`, `agent-device orientation landscape-left`
turns it the same way.
- [x] The agent-device page says `orientation` on an iOS simulator goes
through Simlock and replies unconfirmed, and that a `batch` step does
not. (`website/.../using-devices/agent-device.mdx`)

## Assumptions

none

## Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 1 blocking, 1
fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Round 2: no findings; task/1107 round-2 fixes merged in — a65cdee
Rounds: 2. Tokens: n/a.
Assessment: complete

*Written by an agent.*

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Szymon Chmal <szymon@chmal.it>
V3RON added a commit that referenced this pull request Oct 31, 2026
….rotate uses it (#1106)

Refs #1105

ADR 0053: the daemon owns each lease's device input, so `device.rotate`
works with the input module off. Implemented by #1122, #1123 and #1124
(all merged); this PR flips its status to Accepted.

## Review

Spec review: skipped. Code review: skipped. Claims review: skipped.
Assessment: complete

The maintainer approved the ADR in the #1105 spec session; docs-only ADR
PRs get no code review.

*Written by an agent.*

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Szymon Chmal <szymon@chmal.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

device.rotate: rotate a leased iOS simulator over the contract, HTTP and the client

2 participants